package com.zhmsky.model;

import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * @description 自定义返回结果集
 * @author zhmsky
 * @date 2021/11/12 13:42
 */
@Component
public class ResultMap extends HashMap<String,Object> {
      public ResultMap(){

      }
      public ResultMap success(){
          this.put("result","success");
          return this;
      }

      public ResultMap fail(){
          this.put("result","fail");
          return this;
      }
      public ResultMap code(int code){
          this.put("code",code);
          return this;
      }
      public ResultMap message(Object message){
          this.put("message",message);
          return this;
      }
}
